MESSAGE(STATUS "Looking for dnet")
FIND_PATH(DNET_INCLUDE_PATH 
	NAMES
		dnet.h
	PATHS
		/usr/include
		/usr/include/dnet
		/usr/local/include
		/usr/local/include/dnet
		/sw/include
		/sw/include/dnet
		/opt/local/include
		/opt/local/include/dnet
		NO_DEFAULT_PATH)

FIND_LIBRARY(DNET_LIBRARY_PATH
	NAMES
		dnet
	PATHS
		/usr/lib64
		/usr/lib64/dnet
		/usr/lib
		/usr/lib/dnet
		/usr/local/lib64
		/usr/local/lib64/dnet
		/usr/local/lib
		/usr/local/lib64/dnet
		/sw/lib
		/sw/lib/dnet
		/opt/local/lib
		/opt/local/lib/dnet
		NO_DEFAULT_PATH)

IF(DNET_INCLUDE_PATH)
	SET(PCAP_FOUND 1 CACHE STRING "Set to 1 if dnet is found, 0 otherwise")
	MESSAGE(STATUS "Looking for dnet headers - found")
ELSE(DNET_INCLUDE_PATH)
	SET(DNET_FOUND 0 CACHE STRING "Set to 1 if dnet is found, 0 otherwise")
	MESSAGE(FATAL_ERROR "Looking for dnet headers - not found. Download from http://sourceforge.net/projects/libdnet/")
ENDIF(DNET_INCLUDE_PATH)

IF(DNET_LIBRARY_PATH)
	SET(DNET_FOUND 1 CACHE STRING "Set to 1 if dnet is found, 0 otherwise")
	MESSAGE(STATUS "Looking for dnet library - found")
ELSE(DNET_LIBRARY_PATH)
	SET(DNET_FOUND 0 CACHE STRING "Set to 1 if dnet is found, 0 otherwise")
	MESSAGE(FATAL_ERROR "Looking for dnet library - not found. Download from http://sourceforge.net/projects/libdnet/")
ENDIF(DNET_LIBRARY_PATH)

MARK_AS_ADVANCED(DNET_FOUND)
